home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2531 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  4.3 KB

  1. Path: news.cc.uic.edu!sunphy1!olczyk
  2. From: olczyk@sunphy1 (Jung Oh)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: C++ with Zapp vs. Delphi
  5. Followup-To: comp.lang.c++,comp.lang.pascal.delphi.misc
  6. Date: 18 Jan 1996 07:27:29 GMT
  7. Organization: University of Illinois at Chicago
  8. Message-ID: <4dksp1$3d6c@tigger.cc.uic.edu>
  9. References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com>
  10. NNTP-Posting-Host: sunphy1.phy.uic.edu
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. pbe@pobox.com wrote:
  14. :      Oh, but you'll accept MS's claim that VB4 is OO? (One of their TechEd'
  15. : s in an article even said it was not OO)
  16. Duh---deep deep question considering the fact that I never once 
  17. said anything about VB4. Very funny considering that I recently trashed a local
  18. consulting company which sold their methodology -- combining VB with
  19. structured analysis and design-- as OO.
  20.  
  21. :      MI is not a requirement for OO, and many don't think it should exist at
  22. : all. "Goto of the 90's".
  23. Mostly Smalltalk programers, who would also say that static typing shouldn't
  24. exist.
  25.  
  26. :      Is my car not a car because I don't have a two side mirrors? (Mine does
  27. : though)
  28. If the mirrors you have fail to give a good view you'll get a ticket.
  29. If the mirrors are from a different car and don't fit right that may happen.
  30. More to the point. If the cylinders are from a different engine type
  31. as the cylinders then most  likely the engine won't work. But if it does
  32. work, there is a high probability that the engine will sieze or burst into 
  33. flames. It's not enough to just collect parts. The parts have to work
  34. together well. In programming, it's not enough to have unit tests. You have
  35. to run system tests too.
  36. SI and static typing are parts that do not work together well.
  37.  
  38.  
  39. : >The lack of multiple inheritence means that some objects cannot 
  40. : >send messages to other objects despite the fact that the message is in 
  41. : >the public part of the interface. There are two methods to get around
  42. : >this: typecasting which is a maintanance nightmare, and faking inheritence
  43. : >which is still a maintainance nightmare. In the VCL Borland often chose to
  44. : >fake inheritance. 
  45.  
  46. :      Unless you are doing something out of the ordinary, you type cast to the
  47. : lowest common denomiator and then send the message.
  48.  
  49. :      It can however in certain situations be cumbersome. (Rarely though)
  50. Often. Example below.
  51.  
  52. : >Lack of generics(templates) means you can't construct decent
  53. : >container classes.
  54.  
  55. :      Create your own, get free source, and use Polymorphism!
  56. My point about MI exactly (the polymorphism part). 
  57. 1) Create my own -- great spend my time writing container classes instead of
  58.    applications.
  59. 2) AFIK they don't exist either free or for money. I guess they are to hard to
  60.    write.
  61. But it does raise an interesting problem.
  62. How do you write a class SortedList which maintains a list of objects which 
  63. have a method CompareTo. This lists keeps the objects in sorted order based
  64. on CompareTo. You also know that 
  65. 1) It will be used over a long period of time, and there will be many different
  66.    classes stored there.
  67. 2) In some applications, there will be several instances which hold
  68.    different types.
  69. 3) Some of the objects stored come from classes which have to inherit from
  70.    something else.
  71. 4) Management insists that programmers only get dcu's-- no source. They 
  72.    know that distributing source over the organization causes some of the 
  73.    worst maintenance problems.
  74.  
  75. If you have MI it's easy. Just create a class called SortedObject with
  76. a virtual method called CompareTo. Store objects of that type in the list.
  77. An class that need to get stored can then inherit from SortedObject.
  78. Unfortunately you can't use this in Delphi since you know some of the
  79. classes already inherit from something else.
  80.  
  81. If your language is dynamically typed, it's easy. In the sort routine
  82. send the message CompareTo. Unfortunatly Delphi is statically typed.
  83.  
  84. So can you solve this problem in Delph? It's easy in Smalltalk,Simula,
  85. C++, Eiffel( don't know about OOCobol or Ada95, but I suspect it is easy in 
  86. Ada95 ) oh yeah and Java. Since this problem is easy in the mainline OO 
  87. languages, by what justification do you say that Delphi is OO.
  88. ---------------------
  89. Thaddeus L. Olczyk
  90.